﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace MovieWebApp.Controls
{
    public partial class MemberArea : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            if (Session["User"]=="Guest")
            {
                btnSignIn.Visible = true;
                btnSignUp.Visible = true;
                btnSignOut.Visible = false;
                btnAccount.Visible = false;
            }
            else
            {
                btnSignIn.Visible = false;
                btnSignUp.Visible = false;
                btnSignOut.Visible = true;
                btnAccount.Visible = true;
            }
            
            
        }

        protected void btnSignOut_Click(object sender, EventArgs e)
        {
            FormsAuthentication.SignOut();
            Session["User"] = "Guest";
            Response.Redirect("~/Pages/Home.aspx");
            
        }

        protected void btnSignUp_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/Pages/Check_Login.aspx");
        }

        protected void btnSignIn_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/Pages/Check_Login.aspx");
        }

        protected void btnAccount_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/Pages/Member.aspx");
        }
    }
}